package com.graduate.game.user.service;

import com.graduate.game.user.mapper.relationMapper;
import com.graduate.game.user.pojo.conversation;
import com.graduate.game.user.pojo.relation;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class relationServiceImpl implements relationService {
    @Resource
    public relationMapper relationMapper;

    @Override
    public boolean addrelation(relation relation) {
        int x = relationMapper.addRelation(relation);
        if(x>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public List<relation> checkmyrelation(String me) {
        return relationMapper.checkmyRelations(me);
    }

    @Override
    public boolean addConversation(conversation conversation) {
        int x = relationMapper.addconversations(conversation);
        if(x>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public List<conversation> checkcontConversations(conversation conversation) {
        return relationMapper.checkconcersation(conversation);
    }
}
